package com.yl.pattern.structuralmodel.decorator;

import java.awt.*;

/**
 * @Author 小羊
 * @Date 30/10/2024下午 9:15
 * @ClassName Egg
 * @Description 鸡蛋类（具体的装饰者）
 */
public class Egg extends Garnish {
    public Egg(FastFood fastFood) {
        super(fastFood,1,"鸡蛋");
    }

    @Override
    public float cost() {
        //计算价格
        return getFastFood().cost()+getPrice();
    }

    @Override
    public String getDesc() {
        return super.getDesc()+getFastFood().getDesc();
    }
}
